package br.brpv.silvestrin.vendas.domain;

import android.os.Parcel;
import android.os.Parcelable;

public class Client implements Parcelable{
	private String codClient;
	private String name;
	private String clientId;
	
	public Client(String codClient, String name, String clientId) {
		super();
		this.codClient = codClient;
		this.name = name;
		this.clientId = clientId;
	}
	
	public Client(Parcel in) {
		readFromParcel(in);
	}
	
	private void readFromParcel(Parcel in) {
		codClient = in.readString();
		name = in.readString();
		clientId = in.readString();
	}

	public String getCodClient() {
		return codClient;
	}
	
	public String getName() {
		return name;
	}
	
	public String getClientId() {
		return clientId;
	}

	@Override
	public String toString() {
		return name;
	}

	@Override
	public int describeContents() {
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeString(codClient);
		dest.writeString(name);
		dest.writeString(clientId);
	}
	
	public static final Parcelable.Creator<Client> CREATOR =
	    	new Parcelable.Creator<Client>() {
	            public Client createFromParcel(Parcel in) {
	                return new Client(in);
	            }
	 
	            public Client[] newArray(int size) {
	                return new Client[size];
	            }
	        };
	 
}
